package com.dtb.trade.dao.mysql;

import com.dtb.trade.entity.PointDeal;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.type.JdbcType;

/**
 * @Author:ChengJian
 * @Description:
 * @Date: Created in 下午3:40 2018/8/10
 */
public interface TestDao {

    @Insert({
            "insert into t_point_deal(DEAL_ID,BUY_USER_ID,BUY_ORDER_ID,SELL_USER_ID,SELL_ORDER_ID,POINT_ID,DEAL_DATE,DEAL_NUM," +
                    "DEAL_UNIT_PRICE,DEAL_PRICE) values(#{dealId},#{buyUserId},#{buyOrderId},#{sellUserId},#{sellOrderId}," +
                    "#{pointId},#{dealDate},#{dealNum},#{dealUnitPrice},#{dealPrice})"
    })
    @Results({
            @Result(column = "DEAL_ID",property = "dealId",jdbcType = JdbcType.VARCHAR),
            @Result(column = "BUY_USER_ID",property = "buyUserId",jdbcType = JdbcType.INTEGER),
            @Result(column = "BUY_ORDER_ID",property = "buyOrderId",jdbcType = JdbcType.BIGINT),
            @Result(column = "SELL_USER_ID",property = "sellUserId",jdbcType = JdbcType.INTEGER),
            @Result(column = "SELL_ORDER_ID",property = "sellOrderId",jdbcType = JdbcType.BIGINT),
            @Result(column = "POINT_ID",property = "pointId",jdbcType = JdbcType.INTEGER),
            @Result(column = "DEAL_DATE",property = "dealDate",jdbcType = JdbcType.DATE),
            @Result(column = "DEAL_NUM",property = "dealNum",jdbcType = JdbcType.INTEGER),
            @Result(column = "DEAL_UNIT_PRICE",property = "dealUnitPrice",jdbcType = JdbcType.DOUBLE),
            @Result(column = "DEAL_PRICE",property = "dealPrice",jdbcType = JdbcType.DOUBLE),
    })
    int addPoint(PointDeal pointDeal);
}
